package com.huanying.goodjob.store;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.huanying.framework.adminuser.Adminuser;
import com.huanying.goodjob.business.BusinessList;
import com.huanying.goodjob.community.Area;

@Entity
@Table(name = "store")
public class Store implements Serializable{
	private static final long serialVersionUID = -8714406550574846572L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	private String shopname;  //店铺名称
	private String phone;  //电话
	private int type;  //经营类型
	private String tradeimg_url;  //营业执照路径
	private String shopmanagename; //店长姓名
	private String introduce; //简介
	private Double latitude; //纬度
	private Double longitude; //经度
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "user_id")
	private Adminuser user;   //登陆者
	public Adminuser getUser() {
		return user;
	}
	public void setUser(Adminuser user) {
		this.user = user;
	}
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "businesslist_id")
	private BusinessList businesslist;  //工单id
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "city_code")
	private Area city;  //城市

	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "province_code")
	private Area province;  //省
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "county_code")
	private Area county;  //区
	public Area getCity() {
		return city;
	}
	public void setCity(Area city) {
		this.city = city;
	}
	public Area getProvince() {
		return province;
	}
	public void setProvince(Area province) {
		this.province = province;
	}
	public Area getCounty() {
		return county;
	}
	public void setCounty(Area county) {
		this.county = county;
	}
	@Column(name = "status", nullable = false, columnDefinition = "INT default 1")
	private int status;
	  public BusinessList getBusinesslist() {
		return businesslist;
	}
	public void setBusinesslist(BusinessList businesslist) {
		this.businesslist = businesslist;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getShopname() {
		return shopname;
	}
	public void setShopname(String shopname) {
		this.shopname = shopname;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getTradeimg_url() {
		return tradeimg_url;
	}
	public void setTradeimg_url(String tradeimg_url) {
		this.tradeimg_url = tradeimg_url;
	}
	public String getShopmanagename() {
		return shopmanagename;
	}
	public void setShopmanagename(String shopmanagename) {
		this.shopmanagename = shopmanagename;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public Double getLatitude() {
		return latitude;
	}
	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}
	public Double getLongitude() {
		return longitude;
	}
	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}
